-- @owner: zou_jialiang050
-- @date: 2023/4/12
-- @testpoint: alter指定schema.function_name

--step1:创建schema;expect:成功
drop schema if exists sch_alter_009;
create schema sch_alter_009;

--step2:使用普通用户创建function;expect:成功
drop table if exists sch_alter_009.t_alter_009;
create table sch_alter_009.t_alter_009(c1 int);
insert into sch_alter_009.t_alter_009 values(100);
create or replace function sch_alter_009.f_alter_009()
returns int
as $$
declare
total int;
begin
select * into total from t_alter_009;
return total;
end;
$$ language plpgsql;
/

--step3:执行alter function命令;expect:成功
alter function sch_alter_009.f_alter_009 sql security invoker;

--step4:清理环境;expect:成功
drop function if exists sch_alter_009.f_function_009;
drop schema if exists sch_alter_0009 cascade;